/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "scaltbareainve")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Scaltbareainve.findAll", query = "SELECT s FROM Scaltbareainve s"),
    @NamedQuery(name = "Scaltbareainve.findByScaltbareainveid", query = "SELECT s FROM Scaltbareainve s WHERE s.scaltbareainveid = :scaltbareainveid"),
    @NamedQuery(name = "Scaltbareainve.findByNombre", query = "SELECT s FROM Scaltbareainve s WHERE s.nombre = :nombre"),
    @NamedQuery(name = "Scaltbareainve.findByObservaciones", query = "SELECT s FROM Scaltbareainve s WHERE s.observaciones = :observaciones")})
public class Scaltbareainve implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "scaltbareainveid")
    private Integer scaltbareainveid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 150)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @JoinColumn(name = "scintborganismid", referencedColumnName = "scintborganismid")
    @ManyToOne(optional = false)
    private Scintborganism scintborganismid;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scaltbareainveid")
    private Collection<Scaltblineinve> scaltblineinveCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scaltbareainveid")
    private Collection<Pydgtbaresene> pydgtbareseneCollection;

    public Scaltbareainve() {
    }

    public Scaltbareainve(Integer scaltbareainveid) {
        this.scaltbareainveid = scaltbareainveid;
    }

    public Scaltbareainve(Integer scaltbareainveid, String nombre, String observaciones) {
        this.scaltbareainveid = scaltbareainveid;
        this.nombre = nombre;
        this.observaciones = observaciones;
    }

    public Integer getScaltbareainveid() {
        return scaltbareainveid;
    }

    public void setScaltbareainveid(Integer scaltbareainveid) {
        this.scaltbareainveid = scaltbareainveid;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    public Scintborganism getScintborganismid() {
        return scintborganismid;
    }

    public void setScintborganismid(Scintborganism scintborganismid) {
        this.scintborganismid = scintborganismid;
    }

    @XmlTransient
    public Collection<Scaltblineinve> getScaltblineinveCollection() {
        return scaltblineinveCollection;
    }

    public void setScaltblineinveCollection(Collection<Scaltblineinve> scaltblineinveCollection) {
        this.scaltblineinveCollection = scaltblineinveCollection;
    }

    @XmlTransient
    public Collection<Pydgtbaresene> getPydgtbareseneCollection() {
        return pydgtbareseneCollection;
    }

    public void setPydgtbareseneCollection(Collection<Pydgtbaresene> pydgtbareseneCollection) {
        this.pydgtbareseneCollection = pydgtbareseneCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (scaltbareainveid != null ? scaltbareainveid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Scaltbareainve)) {
            return false;
        }
        Scaltbareainve other = (Scaltbareainve) object;
        if ((this.scaltbareainveid == null && other.scaltbareainveid != null) || (this.scaltbareainveid != null && !this.scaltbareainveid.equals(other.scaltbareainveid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Scaltbareainve[ scaltbareainveid=" + scaltbareainveid + " ]";
    }
    
}
